﻿namespace WFBot.Framework.Domain
{
    using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel;

    public class Question : IEntity
    {
        public Question()
        {
            IsActive = true;
            IsIdentifier = false;
        }

        public virtual long Id { get; set; }

        [Required]
        public virtual bool IsActive { get; set; }

        /// <summary>
        /// If the question is an identifier, the reply from the visitor is 
        /// saved as an identifier information
        /// </summary>
        [Required]
        public virtual bool IsIdentifier { get; set; }

        [Required]
        [StringLength(250)]
        public virtual string Text { get; set; }

        public virtual string Options { get; set; }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public virtual int InternalType
        {
            [EditorBrowsable(EditorBrowsableState.Never)]
            get;
            [EditorBrowsable(EditorBrowsableState.Never)]
            set;
        }

        public QuestionType Type
        {
            get
            {
                return (QuestionType)InternalType;
            }
            set
            {
                InternalType = (int)value;
            }
        }
    }
}
